package com.xiaotao.service.impl;

import com.xiaotao.entity.Wallet;
import com.xiaotao.mapper.WalletMapper;
import com.xiaotao.service.WalletService;
import com.xiaotao.util.ResponseEnum;
import com.xiaotao.util.ResponseUtil;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

@Service
public class WalletServiceImpl implements WalletService {
    @Resource
    private WalletMapper walletMapper;
    @Override
    public ResponseUtil queryByUserId(Integer userId) {
        Wallet wallet = walletMapper.queryByUserId(userId);
        return wallet!=null ? ResponseUtil.get(ResponseEnum.OK,wallet):
                ResponseUtil.get(ResponseEnum.FAIL);
    }
}
